package threading;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-07-03
 * Time: 16:58
 */
public class ThreadDemo7 {
    public static void main(String[] args) {
        Thread t = new Thread(() -> {
            System.out.println("Hello t");
        });

        t.start();

        try {
            //t线程没有循环，会迅速执行完毕，t线程结束消失，但是t对象还在
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println(t.isAlive());//判断t线程是否结束消失
    }
}